package com.example.es02.controller;

import com.example.es02.service.TestService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;

@RestController
public class TestController {
    @Autowired
    private TestService testService;
    @GetMapping("addAll")
    public String addAll(){
        return testService.newaddAll();
    }
    @GetMapping("upnew")
    public String upnew(String id){
        return testService.upnew(id);
    }

    @GetMapping("select")
    public List<Map<String, Object>> select(String key, String indexName, Integer size, Integer page){
        return testService.select(key,indexName,size,page);
    }
    @GetMapping("de")
    public String de(String index,String... key){
        return testService.de(index,key);
    }

}
